package def

type Serialize interface {
	Unmarshal(data []byte, v interface{}) (err error)
	Marshal(v interface{}) (b []byte, err error)
}

type Serializer interface {
	Unmarshal(b []byte) error
	Marshal() ([]byte, error)
}

type OptimizeSerializer interface {
	Serializer
	Copy(serialize OptimizeSerializer)
	Release()
	Alloc()
}

type Stream interface {
	Payload() ([]byte, error)
	Release()
}

type AutoSerializer interface {
	Alloc()
	Release()
}
